package com.dyzx.hbb.modules.sys.controller;

import com.dyzx.hbb.common.base.Result;
import com.dyzx.hbb.modules.sys.entity.SysApp;
import com.dyzx.hbb.modules.sys.service.SysAppService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/sys/app")
public class SysAppController {
    @Autowired
    private SysAppService sysAppService;

    //check app
    @GetMapping("/check/{platform}/{versionCode}")
    public Result<SysApp> check(@PathVariable String platform,@PathVariable String versionCode) {
        SysApp result = sysAppService.check(platform,versionCode);
        if(result != null){
            return Result.ok(result);
        }else {
            return Result.error("版本号不存在");
        }
    }
}
